<!DOCTYPE html>
<html>
<head>
<?php $this->load->view('head'); ?>
</head>
<body>
<?php $this->load->view('header'); ?>
<div class="container-fluid main">
	<div class="row">
<?php $this->load->view('left'); ?>
		<div class="main-content col-md-10">
<?php $this->load->view('crumbs'); ?>
			<div class="panel panel-default panel-my">
				<div class="panel-heading">
					<span class="mr10">链接列表</span>
					<a class="btn btn-success btn-xs" href="<?php echo site_url('admin/link/add'); ?>" title="添加"><i class="glyphicon glyphicon-plus"></i> 添加</a>
				</div>
				<div class="panel-body">
					<form class="form-horizontal J-ajax-form" action="<?php echo site_url('admin/link'); ?>" method="post" accept-charset="utf-8" role="form">
						<div class="table-responsive">
							<table class="table table-striped table-hover">
								<thead>
									<tr>
										<th class="text-center" width="50">删除</th>
										<th width="180">站点名称</th>
										<th width="250">站点地址</th>
										<th width="130">站点logo</th>
										<th width="70">排序</th>
										<th class="text-center" width="50">状态</th>
										<th>管理</th>
									</tr>
								</thead>
								<tbody>
<?php foreach ($links as $link) { ?>
									<tr>
										<td class="text-center"><input class="J_check" type="checkbox" name="link_id[]" value="<?php echo $link['link_id']; ?>"></td>
										<td><?php echo $link['name']; ?></td>
										<td><a href="<?php echo $link['url']; ?>" target="_blank"><?php echo $link['url']; ?></a></td>
										<td><?php echo $link['logo']; ?></td>
										<td><div class="length0"><input class="form-control input-sm" type="text" name="data[<?php echo $link['link_id']; ?>][vieworder]" value="<?php echo $link['vieworder']; ?>"></div></td>
										<td class="text-center"><input type="checkbox" name="data[<?php echo $link['link_id']; ?>][status]" value=""<?php echo Utility::if_check($link['status']); ?>></td>
										<td>
											<a class="mr5" href="<?php echo site_url('admin/link/edit?link_id=' . $link['link_id']); ?>">编辑</a>
											<a href="<?php echo site_url('admin/link/dodel?link_id=' . $link['link_id']); ?>">删除</a>
										</td>
									</tr>
<?php } ?>
								</tbody>
							</table>
						</div>
						<!--/.table-responsive -->
<?php if ($links) { ?>
						<div class="btn-wrap">
							<button type="submit" class="btn btn-primary J-ajax-submit-btn mr10">确认提交</button>
							<button type="button" class="btn btn-danger J-ajax-submit-btn mr5" data-subcheck="true" data-msg="确定要删除吗？" data-action="<?php echo site_url('admin/link/dodel'); ?>">删除</button>
						</div>
						<div class="pages">
							<?php echo $this->pagination->create_links(); ?>
						</div>
<?php } ?>
					</form>
				</div>
				<!--/.panel-body -->
			</div>
			<!--/.panel -->
		</div>
		<!--/.main-content -->
	</div>
	<!--/.row -->
</div>
<!--/.container-fluid -->
<?php $this->load->view('footer'); ?>
</body>
</html>